package com.sairobo.base.common.utils;

import java.util.ResourceBundle;


/**
 * 加载配置参数
 */
public abstract class PropertyUtils {
    protected abstract ResourceBundle getResource();

    /**
     * 获取Property文件中key对应的value
     * @param key
     * @param params
     * @return
     */
    final public String getMessage(String key, Object... params) {
        if (params != null && params.length > 0) {
            return String.format(getResource().getString(key), params);
        }
        return getResource().getString(key);
    }
}
